package samples;

import agent.AgentBoard;
import agent.AgentHand;
import agent.DominoAgent;
import core.basic.Movement;
import core.basic.Piece;

public class LastMatch implements DominoAgent{

	@Override
	public Movement getMovement(AgentHand yourHand, AgentBoard currentBoard) {
		Movement res = new Movement();
		res.pass = true;
		for (Piece piece : yourHand) {
			if (currentBoard.canPut(piece)) {
				res.p = piece;
				res.pass = false;
				res.side = true;
			}
		}
		return res;
	}

	@Override
	public void receiveInfo(Movement m, DominoAgent playerAgent) {
	}

	@Override
	public Movement wrongMovement(Movement wrongMovement) {
		wrongMovement.side = false;
		return wrongMovement;
	}

}
